<%@ page language="java" import="java.util.*,com.maizhi.service.impl.UserServiceImpl" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	UserServiceImpl us = new UserServiceImpl();
	us.loginFlag(request,response);
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";		
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<title>丽水移动人力资源管理平台</title>
 	<c:import url="/liger/liger.jsp"></c:import>
    
     <script type="text/javascript">
            var tab = null;
            var accordion = null;
            var tree = null;
            $(function ()
            {

                //布局
                $("#layout1").ligerLayout({ leftWidth: 150, height: '100%',heightDiff:0,space:2, onHeightChanged: f_heightChanged });

                var height = $(".l-layout-center").height();

                //Tab
                $("#framecenter").ligerTab({ height: height });

                //面板
                $("#accordion1").ligerAccordion({ height: height - 24, speed: null });

                $(".l-link").hover(function ()
                {
                    $(this).addClass("l-link-over");
                }, function ()
                {
                    $(this).removeClass("l-link-over");
                });
                //树
                $("#tree1").ligerTree({
                    data : indexdata,
                    checkbox: false,
                    slide: false,
                    nodeWidth: 120,
                    attribute: ['nodename', 'url'],
                    onSelect: function (node)
                    {
                        if (!node.data.url) return;
                        var tabid = $(node.target).attr("tabid");
                        if (!tabid)
                        {
                            tabid = new Date().getTime();
                            $(node.target).attr("tabid", tabid)
                        } 
                        f_addTab(tabid, node.data.text, node.data.url);
                    }
                });
                
                var link = "<%=request.getContextPath()%>/resourcesController.do?ligerTree";
                $("#menuTree").ligerTree({
                    url:link,
                    checkbox: false,
                    slide: false,
                    nodeWidth: 120,
                    attribute: ['nodename', 'url'],
                    onSelect: function (node)
                    {
                        if (!node.data.url) return;
                        var tabid = $(node.target).attr("tabid");
                        if (!tabid)
                        {
                            tabid = new Date().getTime();
                            $(node.target).attr("tabid", tabid)
                        } 
                        f_addTab(tabid, node.data.text, node.data.url);
                    }
                });

                tab = $("#framecenter").ligerGetTabManager();
                accordion = $("#accordion1").ligerGetAccordionManager();
                tree = $("#tree1").ligerGetTreeManager();
     
                $("#pageloading").hide();


			
            });
            
            
            function f_heightChanged(options)
            {
                if (tab)
                    tab.addHeight(options.diff);
                if (accordion && options.middleHeight - 24 > 0)
                    accordion.setHeight(options.middleHeight - 24);
            }
            
            
            function f_addTab(tabid,text, url)
            { 
                tab.addTabItem({ tabid : tabid,text: text, url: url });
            } 
            
     </script> 
     
     
     <script type="text/javascript">
     	function itemclick(id,item,url)
        {
        	var content=item.text;
        	var link = url;
            var targetObj = document.getElementById('center').contentWindow;
			
			if(targetObj.mzFexistTab(id)==false)
			{
				if(targetObj.mzGetTabCount()<=9)
				{
				targetObj.document.getElementById('tid').innerHTML+="<li id='"+id+"' title='"+content+"'  onClick='mzFrameDis("+id+");' class='tab_li_active'><span>"+content+"<a href='#' title='关闭标签' onclick='mzDeleObj("+id+");'>&nbsp;&nbsp;X&nbsp;&nbsp;</a></span></li>";
				//alert(targetObj.document.getElementById('tid').innerHTML);
				}else{
					alert('TAB显示数目已达上限，请关闭已打开TAB后继续操作');
					return;
				}
				
				if(targetObj.mzFexistFrame(id)==false)
				{
					targetObj.mzAddTabContent(id,link);
					//targetObj.document.getElementById('contents').innerHTML+="<iframe id='f"+id+"' class='frameClass' name='content' src='"+link+"' frameborder='0'></iframe>";
					//alert(targetObj.document.getElementById('contents').innerHTML);
				}
			}
				//跳转到新获取TAB 和 FRAME 
				//targetObj.openWaitingTipWithTop(200);
				targetObj.mzFrameDis(id);
        }
        
        
        var kq_item = { width: 250, items:
            [
            	{ text: '数据上报', click:function(item){itemclick('11',item,'<%=basePath%>hr/hr_xj_file.jsp');}},
            	{ text: '数据查询', click:function(item){itemclick('12',item,'<%=basePath%>hrController.do?xjSqlList');}}
            ]
        };

        var lw_item = { width: 250, items:
            [
           		{text: '考核数据导入',click:function(item){itemclick('22',item,'<%=basePath%>hr/hr_lw_file.jsp');}},
           		{text: '考核数据查询',click:function(item){itemclick('23',item,'<%=basePath%>hrController.do?lwList');}}
            ]
        };
        
        var wb_item = { width: 250, items:
            [
           		{text: '考核数据导入',click:function(item){itemclick('32',item,'<%=basePath%>hr/hr_wb_file.jsp');}},
           		{text: '考核数据管理',click:function(item){itemclick('33',item,'<%=basePath%>hrController.do?wbList');}}
            ]
        };
        
        var xt_item = { width: 250, items:
            [
           		{text: '组织管理',click:function(item){itemclick('41',item,'<%=basePath%>deptController.do?dept');}},
           		{text: '用户管理',click:function(item){itemclick('42',item,'<%=basePath%>userController.do?user');}},
           		{text: '资源管理',click:function(item){itemclick('43',item,'<%=basePath%>resourcesController.do?resource');}},
           		{text: '角色管理',click:function(item){itemclick('44',item,'<%=basePath%>roleController.do?role');}}
            ]
        };
        
        var rz_item = { width: 250, items:
            [
           		{text: '登录日志',click:function(item){itemclick('51',item,'<%=basePath%>deptController.do?dept');}},
           		{text: '操作日志',click:function(item){itemclick('52',item,'<%=basePath%>deptController.do?dept');}},
           		{text: '导出日志',click:function(item){itemclick('53',item,'<%=basePath%>deptController.do?dept');}},
           		{text: '管理日志',click:function(item){itemclick('54',item,'<%=basePath%>deptController.do?dept');}}
            ]
        };
        
        
        $(function ()
        {
            $("#topmenu").ligerMenuBar({ items: [
                { text: ' 首    页 ',click:function(item){itemclick('0',item,'cw/cw_alert.jsp');}},
                { text: ' 考勤管理 ', menu: kq_item },
                { text: ' 劳务工绩效考核 ', menu: lw_item },
                { text: '外包员工绩效考核', menu: wb_item },
                { text: '系统管理', menu: xt_item },
                { text: '日志查询', menu: rz_item },
                { text: '后台管理', click:function(item){itemclick('51',item,'<%=basePath%>user_index.jsp');}},
                { text: '文件管理', click:function(item){itemclick('61',item,'<%=basePath%>upload.jsp');}},
                { text: '文件管理demo',click:function(item){itemclick('71',item,'<%=basePath%>upload2.jsp');}}
            ]
            });

            $("#toptoolbar").ligerToolBar({ items: [
                {
                    text: '<font color=red>${loginUser.name}</font>  你好!  <a href="loginController.do?loginOut">退出</a>', click: function (item)
                    {
                        alert(item.text);
                    }, icon:'icon-add'},
                { line:true },
                { text: '通知：xxxxxxxxxxx', click: itemclick }
            ]
            });
        });
    </script>
     
	 <style type="text/css"> 
	    body,html{height:100%;}
	    body{ padding:0px; margin:0;   overflow:hidden;}  
	    .l-link{ display:block; height:26px; line-height:26px; padding-left:10px; text-decoration:underline; color:#333;}
	    .l-link2{text-decoration:underline; color:white; margin-left:2px;margin-right:2px;}
	    .l-layout-top{background:#102A49; color:White;}
	    .l-layout-bottom{ background:#E5EDEF; text-align:center;}
	    #pageloading{position:absolute; left:0px; top:0px; background:white url('/liger/loading.gif') no-repeat center; width:100%; height:100%;z-index:99999;}
	    .l-link{ display:block; line-height:22px; height:22px; padding-left:16px;border:1px solid white; margin:4px;}
	    .l-link-over{ background:#FFEEAC; border:1px solid #DB9F00;} 
	    .l-winbar{ background:#2B5A76; height:30px; position:absolute; left:0px; bottom:0px; width:100%; z-index:99999;}
	    .space{ color:#E7E7E7;}
	    /* 顶部 */ 
	    .l-topmenu{ margin:0; padding:0; height:31px; line-height:31px; background:url('/liger/lib/images/top.jpg') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;  }
	    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px; line-height:26px;background:url('/liger/lib/images/topicon.gif') no-repeat 10px 5px;}
	    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
	    .l-topmenu-welcome a{ color:#E7E7E7; text-decoration:underline} 
	 </style>
 
 
  </head>
  
<body style="padding:0px;background:#FFFFFF;">  
<div id="pageloading"></div>  
 
<!-- 
 <div style="height:80px;line-height:30px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#ffffff,endColorStr=#ffffff);background-img('img/yd_log.jpg');">
		 <div style="float:right;margin-right:20px;">
		 </div>
 </div>
 -->
 
<div style="height:80px;background-color:#004080;color:#ffffff;" >
		<div style="margin-top:20px;margin-left:15px;letter-spacing:5px;"><h2>丽水移动人力资源管理平台</h3></div>
		
		<div style="height:20px;float:right;margin-right:20px;">  
			<font>${loginUser.name}</font>  你好!  <a href="loginController.do?loginOut">退出</a>
		</div>
</div>

 
<div style="height:80px;line-height:30px;">
		<div id="topmenu" style="border-top:thin solid 1px #cccccc;">
</div>

<div id="layout1" style="width:100%;height:100%; margin:0 auto;margin-top:-1px;background:#FFFFFF;border:0px;">
	<div position="center" style="border:0px;"> 
		<iframe id="center" src="hr/hr_tab.jsp" width="100%" height="100%" frameborder=0/>
	</div>
</div>

</body>
</html>
